package com.ztgf.commodity.models.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.ztgf.commodity.models.bo.*;
import com.ztgf.commodity.models.dto.CommodityInfoDTO;
import com.ztgf.commodity.models.vo.*;
import com.ztgf.common.constant.Result;
import com.ztgf.search.models.dto.EsGoodsDTO;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * author: chenyu.wang
 * date: 2020-05-25 14:49
 * Description: 商品info
 */
public interface ICommodityInfoService extends IService<CommodityInfoDTO> {

    List<CommodityInfoHotSellVO> getShopHotSell(Long shopId);

    void updateBatchPublish(Long id);

    Result<List<String>> deleteLogic(Long id);

    Result<List<String>> updateStatus(Long id);

    Result<List<String>> saveReleaseCommodity(CommodityReleaseBO bo);

    Map<String,List> getCommodityList(List<CommodityReleaseBO> commodityReleaseBOList);

    Page<CommoditySellerVO> querySellerPageList(CommoditySellerVO sellerVO);

    Page<CommoditySellerVO> querySellerReviewList(CommoditySellerVO sellerVO);

    /**
     * description: 卖家个人中心未上架产品列表
     * param: [sellerVO]
     * author: chenyu.wang
     * date: 2020-06-09
     * return: com.baomidou.mybatisplus.plugins.Page<com.ztgf.commodity.models.vo.CommoditySellerVO>
     */
    Page<CommoditySellerVO> querySellerNotOnGoodsList(CommoditySellerVO sellerVO);

    /**
     * description: 卖家个人中心上架中的产品列表
     * param: [bo]
     * author: chenyu.wang
     * date: 2020-06-09
     * return: com.baomidou.mybatisplus.plugins.Page<com.ztgf.commodity.models.vo.CommodityInPutawayVO>
     */
    Page<CommodityInPutawayVO> querySellerInPutawayList(CommodityInPutawayBO bo);

    /**
     * description: 卖家个人中心库存管理列表
     * param: [bo]
     * author: chenyu.wang
     * date: 2020-06-09
     * return: com.baomidou.mybatisplus.plugins.Page<com.ztgf.commodity.models.vo.CommodityInventoryVO>
     */
    Page<CommodityInventoryVO> querySellerInventoryList(CommodityInventoryBO bo);

    /**
     * description: 修改商品
     * param: [bo]
     * author: chenyu.wang
     * date: 2020-05-29
     * return: boolean
     */
    Result<List<String>> update(CommodityReleaseBO bo);

    /**
     * description: 物理删除商品，并删除关联规格信息
     * param: [id]
     * author: chenyu.wang
     * date: 2020-05-29
     * return: boolean
     */
    Result<List<String>> deletePhysical(Long id);

    /**
     * description: 根据id商品价格，用于其它接口调用
     * param: [id]
     * author: chenyu.wang
     * date: 2020-06-03
     * return: com.ztgf.commodity.models.vo.CommodityPriceVO
     */
    CommodityPriceVO getByIdOtherInterface(Long id);

    /**
     * description: 商城商品基础详细信息
     * param: [id]
     * author: chenyu.wang
     * date: 2020-06-05
     * return: com.ztgf.commodity.models.vo.CommodityDetailsVO
     */
    CommodityDetailsVO getCommodityDetails(Long id);

    /**
     * description: 统计销量人气，用于商品详情页，参数为商品id
     * param: [goodsId]
     * author: chenyu.wang
     * date: 2020-06-05
     * return: java.lang.Integer
     */
    Integer getCountSales(Long goodsId,Long shopId);

    /**
     * description: 商城商品详情页，同类商品推荐
     * param: [id] 分类id
     * author: chenyu.wang
     * date: 2020-06-05
     * return: java.util.List<com.ztgf.commodity.models.vo.CommoditySimilarVO>
     */
    List<CommoditySimilarVO> getSimilarCommodity(Long id);

    /**
     * description: 根绝店铺ID，获取该店铺下商品总数
     * param: [id]
     * author: zhanghualang
     * date: 2020-06-05
     * return: integer
     */
    Integer getCommodityNumByShopId(Long shopId);

    /**
     * description: 根据店铺ID ，判断该店铺下新品数量
     * param: [id]
     * author: zhanghualang
     * date: 2020-06-05
     * return: integer
     */
    Integer getShopCommodityIsNew(Long shopId);

    void updateBatchPublishByShopBrand(Long shopId, Long brandId);

    /**
     * description: 根据ids查询商品
     *
     * @param ids
     * @return
     */
    List<CommodityInfoDTO> queryByIds(String ids);

    Page<CommodityRecycleBinVO> querySellerRecycleBinList(CommodityRecycleBinBO bo);

    Result<List<String>> deleteLogicBatch(String ids);

    Result<List<String>> updateBatchRestore(String ids);

    Result<List<String>> updateBatchUpFrame(String ids);

    Result<List<String>> updateBatchDownFrame(String ids);

    List<CommodityComboRelationVO> queryGoodsComboMsg(Long goodsId);

    CommodityAttrPriceVO getShoppingCartGoods(Long goodsId, String attributesIds);

    List<CommodityPriceVO> getHighShop(List<OrderHighShopVo> orderHighCommodity);

    Page<CommodityAdminListVO> queryAdminPageList(CommodityAdminListBO bo);

    CommodityRegardVO queryCenterGoodsDetails(Long id);

    CommodityRegardVO queryAdminCenterGoodsDetails(Long id);

    Result updateAuditCommodity(Long id, Long userId, String text, Integer state);

    HashMap<String, Integer> getVariousCommodity(Long shopId); //获取店铺里各种商品商品数量

    List<CommodityInfoRankVO> getCommoditySalesRank(Long shopId); //获取店铺销量排名

    Page<CommodityAuditVO> queryAuditAdminList(CommodityAuditBO bo);

    Result<List<String>> updateViolation(Long id, Integer type, String content);

    List<CommodityDecorationVO> queryShopCommodityList(CommodityDecorationBO bo);

    Result<List<String>> updateBatchAuditCommodity(String ids, Integer state);

    Page<CommodityDecorationVO> queryShopAllCommodityList(CommodityShopAllListBO bo);

    Page<CommodityAdminShopListVO> queryAdminShopCommodityList(CommodityAdminShopListBO bo);

    List<CommodityDecorationVO> queryDecorationCommodityList(CommodityDecorationBO bo);

    CommodityDetailsPageVO queryCommodityDetailsPageData(Long id);

    //List<CommodityEsVO> queryESGoods();

    List<CommodityEsVO> queryAllESGoods(long offset);

    List<CommodityEsVO> queryAllESGoodsByCommodityId(long id);

    int queryAllESGoodsCount();

    CommodityExportVO queryGoodsByIds(Long id);

    List<SpecificationCategoryVO> getGoodsAllAttrs(Long id);

    List<CommoditySKUVO> getGoodsSku(Long id);

    String getGoodsCompare(Long categoryId);

    CommodityAdminExportVO queryAdminExportGoods(Long goodsId);

    Result<List<String>> deleteBatchPhysical(String ids);

    void updateStateByShopId(Long shopId);

    Page<CommodityAdminListVO> queryAdminGoodsRecycleBin(CommodityAdminListBO bo);

    /**
     * @Description: 取消订单返回库存
     * @Author: chenyu.wang
     * @Params: [goodsId, ids, num]
     * @Date: 2020.11.10 16:40
     */
    void updateBackInventory(Long goodsId, String ids, Integer num);

    /**
     * @Description: 打回修改接口
     * @Author: chenyu.wang
     * @Params: [bo]
     * @Date: 2020.11.13 14:09
     */
    Result updateGoodsBack(CommodityReleaseBO bo);

    /**
     * @Description: 根据id查询es商品
     * @Author: chenyu.wang
     * @Params: [goodsId]
     * @Date: 2020.11.20 09:51
     */
    CommodityEsVO queryESGoodsById(Long goodsId);

    /**
     * @Description: 获取商品
     * @Author: chenyu.wang
     * @Params: [vo]
     * @Date: 2020.11.20 09:54
     */
    List<EsGoodsDTO> getEsGoods(CommodityEsVO vo);

    /**
     * @Description: 查询商品套餐，规格属性，用于导出商品
     * @Author: chenyu.wang
     * @Params: [id]
     * @Date: 2020.12.21 16:48
     */
    List<CommodityExportVO> queryAllGoodsSku(Long id);

    /**
     * @Description: admin产品管理导出商品
     * @Author: chenyu.wang
     * @Params: [id]
     * @Date: 2020.12.25 10:39
     */
    List<CommodityAdminExportVO> getAdminExportGoods(Long id);

    /**
     * 处理商品图片加水印（旧数据）
     */
    void doImageUrlWM();

    /**
     * @return : void
     * @Author :chenyu.wang
     * @Description : 商品主图处理
     * @Date : 13:23 2021.01.22
     * @Param : []
     **/
    void updateLogImg();

    /**
     * @return : java.util.List<com.ztgf.commodity.models.vo.GoodsExportVO>
     * @Author :chenyu.wang
     * @Description : 获取卖家端导出的商品信息
     * @Date : 2021.03.03 11:05
     * @Param : [ids]
     **/
    List<GoodsExportVO> getExportSku(String ids);

    /**
     * @return : com.ztgf.common.constant.Result<?>
     * @Author :chenyu.wang
     * @Description : 商品上下架
     * @Date : 2021.03.30 14:35
     * @Param : [id:商品表id]
     **/
    Result<?> commodityOnAndOffShelves(Long id);

    List<CommodityExportNewVO> queryExportList(CommodityAdminListBO bo);

    /**
     * 下架店铺所有商品
     * @param shopId
     * @return
     */
    Result updateNotPublishByShopId(Long shopId, String notes);


    Integer allProducts();

    /**
     * 上架商品个数
     * @return
     */

    /**
     * 获取商品个数
     * @param publishStatus 0未上架、1已上架
     * @return
     */
    Integer getPublishCount(Integer publishStatus);
}
